/*******************************************************************************
 * @file Copyright 2009 The CREATE Lab at CMU
 * 
 *       This file is part of JubJub, an open source project.
 *       http://code.google.com/p/jubjub/
 * 
 *       Redistribution and use in source and binary forms, with or without
 *       modification, are permitted provided that the following conditions are
 *       met:
 * 
 *       Redistributions of source code must retain the above copyright notice,
 *       this list of conditions and the following disclaimer.
 * 
 *       Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 * 
 *       Neither the name of Carnegie Mellon nor the names of its contributors
 *       may be used to endorse or promote products derived from this software
 *       without specific prior written permission.
 * 
 *       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *       "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *       LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 *       PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *       HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *       LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *       DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *       THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *       OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *******************************************************************************/
package edu.cmu.ri.createlab.jj.blocks;

import java.util.List;

import edu.cmu.ri.createlab.jj.blocks.BlockDefs.CallTypes;

/**
 * 
 * @author Erik Pasternak
 *
 * Defines methods common to blocks that can be called.
 * 
 * These methods relate to properties common to blocks that can
 * be called, such as their callName or parameters.
 * 
 * Known implementations:
 * BlockBlock, CodeBlock
 */
public interface CallableBlockInterface
{
   ///returns the callName for this block
   public String getCallName();
   
   ///Checks the given string against the callName for this block
   public boolean isSameCallName(String name);
   
   ///Returns the type of call, either INLINE or METHOD.
   ///Defined in CallTypes
   public CallTypes getCallType();
   
   ///returns the list of parameters as a VarBlock list
   public List<VarBlock> getParams();
   
   ///returns the list of returns as a VarBlock list
   public List getReturns();
   
   ///Sets callType to the specified CallTypes type for the function.
   ///If the type is INLINE this will set the access keywords to null.
   public void setCallType(CallTypes type);

   ///sets the names to be used when outputting the code when different
   ///variable names should be swapped in (mainly INLINE types).
   public void setSwaps(String[] names);
   
   ///Returns the swapNames that are currently in use.
   public String[] getSwaps();

}
